﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MaintainCompetitions.aspx.cs" Inherits="Admin_MaintainCompetitions" %>
<%@ Register Src="~/Share/CompetitionDetails.ascx" TagName="ViewDetailCompetition" TagPrefix="uc2" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

     <div class="cleaner_with_height"></div>
    <div class="float_left">
    <asp:LinkButton ID="btn_AllCompetitions" runat="server" Text="All" 
            onclick="btn_AllCompetitions_Click"></asp:LinkButton> |
    <asp:LinkButton ID="btn_UpcomingCompetitions" runat="server" Text="Upcoming" 
        onclick="btn_UpcomingCompetitions_Click"></asp:LinkButton> |
    <asp:LinkButton ID="btn_OngoingCompetitions" runat="server" Text="Ongoing" 
        onclick="btn_OngoingCompetitions_Click" ></asp:LinkButton> |
    <asp:LinkButton ID="btn_CompletedCompetitions" runat="server" Text="Completed" 
            onclick="btn_CompletedCompetitions_Click" ></asp:LinkButton>
    <br />
     <div class="cleaner_with_height2"></div>
    <asp:Panel ID="pn_DetailCompetition" runat="server">
    </asp:Panel>    
    </div>
    <div class="cleaner"></div>
    <div class="float_left">
        <asp:Button ID="btn_Insert" runat="server" Text="Add new Competition" 
            onclick="btn_Insert_Click" />
        <asp:Button ID="btn_Delete" runat="server" OnClientClick="javascript:return confirmAction();" Text="Delete" 
            onclick="btn_Delete_Click" />        
        <br />
            <asp:Label ID="lb_list" runat="server" Text=""></asp:Label> 
    </div>

   <div class="float_right">   <span>Search <asp:TextBox ID="txtSearch" runat="server" Width="150px"></asp:TextBox>
                            <asp:LinkButton ID="btn_Search" runat="server" Text="Go" 
           onclick="btn_Search_Click"></asp:LinkButton></span>
    </div>
    <div class="cleaner"></div>    
    <div class="cleaner_with_height2"></div>
    <div>
    <asp:GridView ID="grv_Competitions" runat="server" AllowPaging="true" PageIndex="0" 
            PageSize="8" AutoGenerateColumns="false" Width="660px" DataKeyNames="CompetitionID" 
            onpageindexchanging="grv_Competitions_PageIndexChanging">    
    <Columns>
        <asp:TemplateField ItemStyle-Width="10px">
        <ItemStyle HorizontalAlign="Center" />
            <HeaderTemplate>All<asp:CheckBox ID="chk_All" runat="server" AutoPostBack="true" OnCheckedChanged="onCheckedChange" />  </HeaderTemplate>
            <ItemTemplate><asp:CheckBox ID="chk_Item" runat="server" /></ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
        <ItemStyle />
            <HeaderTemplate> Competition Name </HeaderTemplate>
            <ItemTemplate><%#Eval("CompetitionName") %></ItemTemplate>
        </asp:TemplateField>

        <asp:TemplateField>
        <ItemStyle HorizontalAlign="Center" />
            <HeaderTemplate> Start Date </HeaderTemplate>
            <ItemTemplate><%#Eval("StartDate","{0:dd/MM/yyyy}") %></ItemTemplate>
        </asp:TemplateField>

        <asp:TemplateField>
        <ItemStyle HorizontalAlign="Center" />
            <HeaderTemplate> End Date </HeaderTemplate>
            <ItemTemplate><%#Eval("EndDate","{0:dd/MM/yyyy}") %></ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
        <ItemStyle HorizontalAlign="Center" />
            <HeaderTemplate> Conditions</HeaderTemplate>
            <ItemTemplate><%#Eval("Conditions") %></ItemTemplate>
        </asp:TemplateField>

        <asp:TemplateField>
        <ItemStyle HorizontalAlign="Center" />
            <HeaderTemplate> Awards </HeaderTemplate>
            <ItemTemplate>
                <asp:Repeater ID="dtl_Awards" runat="server">
                    <ItemTemplate>                    
                           <span> 
                               <asp:Label ID="txtAwardName" runat="server" Text='<%# Eval("AwardName") %> ' ></asp:Label> 
                               <asp:Label ID="txtPrize" runat="server" Text='<%# Eval("Prize") %> ' ></asp:Label>
                               </span>
                    </ItemTemplate>
                </asp:Repeater>
            </ItemTemplate>
        </asp:TemplateField> 
     
        <asp:TemplateField>
        <ItemStyle HorizontalAlign="Center" />
            <HeaderTemplate>Details</HeaderTemplate>
            <ItemTemplate>
                <a href='MaintainCompetitions.aspx?CompetitionID=<%#Eval("CompetitionID") %>'>Detail</a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
        </asp:GridView>
</div>
</asp:Content>

